package com.ita.acmsystem.merchant.service.impl;

import java.util.List;

import com.ita.acmsystem.merchant.dao.IFoodTypesDao;
import com.ita.acmsystem.merchant.dao.impl.FoodTypesDaoImpl;
import com.ita.acmsystem.merchant.entity.FoodTypes;
import com.ita.acmsystem.merchant.service.IFoodTypesService;

public class FoodTypesServiceImpl implements IFoodTypesService {

	private IFoodTypesDao dao;

	public FoodTypesServiceImpl() {
		super();
		dao = new FoodTypesDaoImpl();
	}

	@Override
	public boolean addFoodTypes(FoodTypes foodTypes) {
		return dao.persist(foodTypes) != null;

	}

	@Override
	public boolean deleteFoodTypes(String typeId) {
		return dao.delete(typeId);
	}

	@Override
	public boolean updateFoodTypes(FoodTypes foodTypes) {
		return dao.update(foodTypes);
	}

	@Override
	public FoodTypes getFoodTypesById(String typeId) {
		return dao.query(typeId);
	}

	@Override
	public List<FoodTypes> getAllFoodTypes() {
		return dao.queryAll();
	}

	public IFoodTypesDao getDao() {
		return dao;
	}

	public void setDao(IFoodTypesDao dao) {
		this.dao = dao;
	}

}
